package com.demo.mapper.demo;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.beans.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.Map;

@Repository
public interface UserMapper extends BaseMapper<User> {
    //注册，保存用户信息
    public Integer saveUserInfo(User user);

    public User queryUserById(String userId);
    public User queryUserByNickname(String nickName);
    public User queryUserByName(String name);
    public User queryUserByUsercode(String userCode);
    public User queryUserByPhonenumber(String phoneNumber);

    @Update("update user set state = #{user.state} where user_id = #{user.userId}")
    public int updateUserState(@Param("user") User user);
}
